﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
 
namespace FtpUpload.Controllers
{
    public class User
    {
        public int ID { get; set; }
        public string Name { get; set; }
    }
    public class HomeController : Controller
    {
        public ActionResult Index(int sortBy = 0)
        {
            ViewBag.Message = "FTP 上传";
            List<User> arr = new List<User> 
            {
                new  User{ID=1,Name="zzl1"},
                new  User{ID=3,Name="zzl3"},
                new  User{ID=2,Name="zzl2"},
            };
            //PredicateList<User> predicateList = new PredicateList<User>();
            //predicateList.Add(i => i.ID > 1);

            //IQueryable<User> linq = arr.AsQueryable();
            //if (sortBy == 0)
            //    linq = linq.LinqForPredicate<User>(predicateList, i => i.Asc(j => j.ID));
            //else
            //    linq = linq.LinqForPredicate<User>(predicateList, i => i.Desc(j => j.ID));
            //ViewBag.User = linq.ToList();
            return View();
        }
        [HttpPost]
        public ActionResult Index(FormCollection form)
        {
            new VCommons.FtpUpload().Upload(Request.Files[0]);
            return View();
        }
        public ActionResult About()
        {
            return View();
        }
    }
}
